using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
using Rotempco.Core.ORM.Objects;

namespace Rotempco.Core.Logic
{
    public class EncryptionLogic
    {
        public static AsymmetricEncryptionKeyPair GenerateAsymmetricEncryptionKeys()
        {
            int dwKeySize = 1024;

            RSACryptoServiceProvider rsaProvider = new RSACryptoServiceProvider(dwKeySize);
            string privateKey = rsaProvider.ToXmlString(true);
            string publicKey = rsaProvider.ToXmlString(false);

            return new AsymmetricEncryptionKeyPair(publicKey, privateKey);
        }

        public static string GenerateSymmetricEncryptionKey()
        {
            return Guid.NewGuid().ToString();
        }
    }
}
